First-class names for effect handlers

نویسندگان

چکیده

Algebraic effects and handlers are a promising technique for incorporating composable computational into functional programming languages. Effect enable concisely with different effects, but they do not offer convenient way to program instances of the same effect. As solution this inconvenience, previous studies have introduced _named effect handlers_, which allow programmer distinguish among instances. However, existing formalizations named both involved restrictive, as employ non-standard mechanisms prevent escaping handler names. In paper, we propose simple flexible design handlers. Specifically, treat names first-class values, their while staying within ordinary λ-calculus. Such is enabled by combining _scoped effects_, novel variation that maintain scope via rank-2 polymorphism. We formalize two combinations scoped implement them in Koka language. also present practical applications handlers, including neural network unification algorithm.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Semantics and Types for Objects with First-Class Member Names

Objects in many programming languages are indexed by first-class strings, not just first-order names. We define λ S (“lambda sob”), an object calculus for such languages, and prove its untyped soundness using Coq. We then develop a type system for λ S that is built around string pattern types, which describe (possibly infinite) collections of members. We define subtyping over such types, extend...

متن کامل

Continuation Passing Style for Effect Handlers

We present Continuation Passing Style (CPS) translations for Plotkin and Pretnar’s effect handlers with Hillerström and Lindley’s row-typed fine-grain call-by-value calculus of effect handlers as the source language. CPS translations of handlers are interesting theoretically, to explain the semantics of handlers, and also offer a practical implementation technique that does not require special ...

متن کامل

Fusion for Free - Efficient Algebraic Effect Handlers

Algebraic effect handlers are a recently popular approach for modelling side-effects that separates the syntax and semantics of effectful operations. The shape of syntax is captured by functors, and free monads over these functors denote syntax trees. The semantics is captured by algebras, and effect handlers pass these over the syntax trees to interpret them into a semantic domain. This approa...

متن کامل

Efficient algebraic effect handlers for Prolog

Recent work has provided delimited control for Prolog to dynamically manipulate the program control-flow, and to implement a wide range of control-flow and dataflow effects on top of. Unfortunately, delimited control is a rather primitive language feature that is not easy to use. As a remedy, this work introduces algebraic effect handlers for Prolog, as a high-level and structured way of defini...

متن کامل

Psychological Factors Affecting Preferences for First Names*

Anecdotal and anthropological evidence suggests that personal names are of considerable psychological significance, but they have not received much attention from psychologists. The relationship between the familiarity of first names and the degree to which they are liked is of particular interest from the point of view of research in related areas of experimental aesthetics. Evidence from inve...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

ژورنال

عنوان ژورنال: Proceedings of the ACM on programming languages

سال: 2022

ISSN: ['2475-1421']

DOI: https://doi.org/10.1145/3563289